import re
from datetime import datetime

from pytz import timezone


def check_if_text_is_english(text: str) -> bool:
    """Проверяем, являются ли буквы латинскими"""

    return re.match("[a-zA-Z]", text) and all(char.isalpha() for char in text.split())


def check_if_data_set(data: dict) -> bool:
    return all([v for v in data.values()])


def get_date_time(time_format="%Y-%m-%d %H:%M:%S", as_string: bool = False):
    date_and_time = (
        datetime.now(timezone("Europe/Moscow"))
        .replace(tzinfo=None)
        .replace(microsecond=0)
    )

    if as_string:
        date_and_time = date_and_time.strftime(time_format)

    return date_and_time
